package com.frontier.consumer8003.controller;

import com.frontier.consumer8003.feign.ProviderFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * openFeign测试控制层
 *
 * @author YLS-XuXu
 * @time 2022/2/24
 */
@RestController
public class TestOpenFeignController {

    /**
     * 引入生产者Feign
     */
    @Autowired
    private ProviderFeignClient providerFeignClient;

    /**
     * 测试OpenFeign
     * openFeign内部默认使用轮询方式负载均衡
     *
     * @return feign返回结果
     */
    @GetMapping("/testOpenFeign")
    public String testOpenFeign() {
        return providerFeignClient.testGateWay();
    }
}
